<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
function selectAd() {
	var coId = $("input[name=co_id]").val();
	window.open('./selectAdNoPopup.ga?co_id=' + coId, 'ad', 'scrollbars=yes,status=no,resizable=no,width=640,height=300');
}

function searchWinner() {
	$.ajax({
		type: "post",
		url: "./winnerResult_detail.ga",
		dataType: "html",
		data: {ad_no: $("input[name=ad_no]").val()},
		success: function (data) {
			$("#result").html( data );
		},
		error: function() {
			alert("오류");
		}
	});
}

</script>

</head>
<body>

<h2>이벤트 결과</h2>

<table width="100%" bgcolor="#eeeeee">
    <tr>
        <td width="12%">광고주 선택</td>
        <td width="10%">
            <input type="button" value="선택"
                onclick="window.open('./selectAdvPopup.ga', 'ad', 'scrollbars=yes,status=no,resizable=no,width=440,height=300')"
            />
        </td>
        <td width="50%">
            <input id="coname_lb" type="text" style="width:400px;" disabled/>
            <input type="hidden" name="co_id"/>
        </td>
    </tr>
    <tr>
        <td>광고 Title 선택</td>
        <td>
            <input type="button" value="선택"
                id="selectAdBtn"
                onclick="selectAd()"
                disabled
            />
        </td>
        <td>
            <input id="ad_lb" type="text" style="width:400px;" disabled/>
            <input type="hidden" name="ad_no"/>
        </td>
        <td>
        	<input type="button" value="검색"
        		style="width:80px;height:24px;"
        		onclick="searchWinner()"
        	/>
        </td>
    </tr>
</table>
<br/><br/><br/>

<div id="result"></div>

</body>
</html>